<script setup lang="ts">
interface Props {
  title: string
  price: string
}
defineProps<Props>()
defineEmits(['mounseenter', 'mouseleave'])
</script>

<template>
  <div class="card" @mouseenter="$emit('mounseenter')" @mouseleave="$emit('mouseleave')">
    <h1 class="title">{{ title }}</h1>
    <div class="price-container">
      <h2 class="price">&yen;{{ price }}</h2>
      <p class="month">每月</p>
    </div>
    <div class="desc">
      <div class="row"></div>
      <div class="row"></div>
      <div class="row"></div>
      <div class="row"></div>
    </div>
  </div>
</template>
<style lang="scss" scoped>
$transition-prop: all 0.2s ease-in-out;
.card {
  width: 160px;
  background-color: #fff;
  padding-bottom: 15px;
  border-radius: 5px;
  transform-origin: 50% 50%;
  transform: scale(1);
  transition: $transition-prop;

  &:hover {
    transform: scale(1.08);

    .title {
      background-color: rgb(6, 164, 117);
    }

    .price {
      color: rgb(6, 164, 117);
    }
  }
  .title {
    padding: 10px;
    margin: 0;
    font-size: 1.1rem;
    text-align: center;
    color: #fff;
    background-color: rgba(6, 164, 117, 0.676);
    transition: $transition-prop;
  }

  .price-container {
    text-align: center;
    .price {
      font-size: 2rem;
      margin-bottom: 2px;
      transition: $transition-prop;
    }

    .month {
      padding: 0;
      margin: 0;
      font-size: 0.8rem;
      color: rgb(120, 118, 118);
    }
  }

  .desc {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    .row {
      width: 4.2rem;
      height: 3px;
      margin: 5px;
      background-color: rgba(192, 192, 201, 0.742);

      &:nth-child(even) {
        width: 3.5rem;
      }
    }
  }
}
</style>
